<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title><?php echo C('TITLE');?></title>
	<meta name="keywords" content="<?php echo C('KEYWORD');?>" />
	<meta name="description" content="<?php echo C('DESCRIPTION');?>" />
	<link href="/Public/skin/css/css.css" rel="stylesheet" type="text/css" />
	<link href="/Public/skin/css/lrtk.css" rel="stylesheet" type="text/css" />
	<script src="/Public/skin/js/jquery-1.11.1.min.js" type="text/javascript"></script>
	<script src="/Public/skin/js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="/Public/skin/js/lrtk.js"></script>
</head>

<body style="position:relative;">
    <!--nav 开始-->
	<div id="header">
    <a class="logo" href="/">
        <img src="/Public/skin/images/logo.jpg" />
    </a>
    <ul class="nav">
        <li>
            <a <?php if($nav_active == 'index'): ?>class="now"<?php endif; ?> href="/">首页</a>
        </li>
        <li>
            <a <?php if($nav_active == 'rank'): ?>class="now"<?php endif; ?> href="<?php echo U('rank/index');?>">赛事排名</a>
        </li>
        <li>
            <a <?php if($nav_active == 'join'): ?>class="now"<?php endif; ?> href="<?php echo U('join/index');?>">招商加盟</a>
        </li>
        <li>
            <a <?php if($nav_active == 'communicate'): ?>class="now"<?php endif; ?> href="<?php echo U('communicate/index');?>">交流吧</a>
        </li>
        <li>
            <a <?php if($nav_active == 'joinus'): ?>class="now"<?php endif; ?> href="<?php echo U('joinus/index');?>">加入我们</a>
        </li>
    </ul>
    <ul class="login">
        <?php if($_SESSION['user']['id'] == ''): ?><li class="l">
                <a href="<?php echo U('login/index');?>">
                    <img src="/Public/skin/images/user.jpg" />登录</a>
            </li>
            <li class="r">
                <a href="<?php echo U('register/index');?>">免费注册</a>
            </li>
        <?php else: ?>
            <li class="l">
                <a href="<?php echo U('user/index');?>">
                    <img src="/Public/skin/images/user.jpg" /><?php echo ($_SESSION['user']['nicename']); ?></a>
            </li>
            <li class="r">
                <a href="<?php echo U('user/loginout');?>">退出</a>
            </li><?php endif; ?>
    </ul>
    <div class="clear"></div>
</div>
    <!--nav 结束-->
    
    <!--赛事排名 开始-->
    <div id="rank_banner"></div>
    <div class="rank">
        <div class="rank_box">
            <div class="sspm_hkt clearfix">
                <?php $rankingPeriods = M('RankingPeriod')->field('id,name')->order('sort asc,id desc')->select(); $rankingPeriods_count = intval(count($rankingPeriods)); $periodsId = $rankingPeriods[$rankingPeriods_count-1]['id']; ?>
                <ul class="ul1" id="sspmhk_tab">
                    <?php if(is_array($rankingPeriods)): $voo_index = 0; $__LIST__ = $rankingPeriods;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$voo): $mod = ($voo_index % 2 );++$voo_index;?><li data-value="<?php echo ($voo["id"]); ?>" <?php if($voo_index == $rankingPeriods_count): ?>class="on"<?php endif; ?>><?php echo ($voo["name"]); ?></li><?php endforeach; endif; else: echo "" ;endif; ?>
                </ul>
                <ul class="ul2"></ul>
            </div>
            <div class="sspm_hkc" id="sspmhk_tab_c">
                <div class="con-hide con-show">
                    <a class="bm" href="<?php echo U('user/signup');?>">我要报名</a>
                    <h1 class="bt">赛事排名</h1>
                    <table cellpadding="0" cellspacing="0">
                        <tr class="thead">
                            <td class="t1-2">名次<i id="MCObj" class="px_up" data-value="1" onclick="SortFun('mc');"></i></td>
                            <td>昵称</td>
                            <td class="t3">总资产<i id="ZZCObj" class="px_none" data-value="0" onclick="SortFun('zzc');"></i></td>
                            <td class="t2">总收益率<i id="ZSYLObj" class="px_none" data-value="0" onclick="SortFun('zsyl');"></i></td>
                            <td class="t2">周收益率</td>
                            <td class="t2">日收益率</td>
                            <td class="t2">仓位</td>
                            <td class="t3">重仓股</td>
                        </tr>
                        <tbody id="SsbmResult"></tbody>
                    </table>
                    <div class="page" id="SsbmPage"></div>
                </div>
            </div>

            <h1 class="bt" style="margin-top:60px;">历史领奖名单</h1>
            <table cellpadding="0" cellspacing="0">
                <tr class="thead">
                    <td>用户名</td>
                    <td class="t1 boder_l">名次</td>
                    <td class="t3">奖金额度</td>
                    <td class="t3">收益率</td>
                    <td class="t3">是否领奖</td>
                    <td class="t3">期数</td>
                </tr>
                <tbody id="LjmdResult"></tbody>
            </table>
            <div class="page" id="LjmdPage"></div>
        </div>
    </div>
    <!--赛事排名 结束-->
    
    <!--footer 开始-->
<div id="footer" class="clearfix">
    <div class="clt2">
        <img src="/Public/skin/images/gzh.png" />
        <p>更多信息请关注公众号</p>
    </div>
    <div class="clt">
        <center class="yqlj-pic"><a href="http://www.hexun.com/" target="_blank"><img src="/Public/skin/images/hx_logo.png"></a></center>
        <p>Copyright © 2010-2017 深圳市森鹏猎头有限公司版权所有 </p>
        <p>备案：粤ICP备17133948号</p>
    </div>
    <div class="crt">
        <img src="/Public/skin/images/awm.jpg" />
    </div>
</div>
<!--footer 结束-->

<img id="piaoc" src="/Public/skin/images/pc.jpg" />
<!-- 飘窗代码 开始 -->
<div id="main">
    <div id="pop" style="display:none;">
        <div id="popHead">
            <a id="popClose" title="关闭">关闭</a>
            <h2></h2>
        </div>
        <div id="popContent">
            <a href="<?php echo U('login/index');?>" target="_blank">
                <img src="/Public/skin/images/300x250.jpg">
            </a>
        </div>
    </div>
    <script>
        var popad = new Pop();
    </script>
</div>
<!-- 飘窗代码 结束 -->

<!--QQ飘浮-->
<div id="qqPiaofu">
    <ul>
        <li><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=360252858&site=qq&menu=yes">360252858</a></li>
        <li><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=360252858&site=qq&menu=yes">360252858</a></li>
        <li><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=360252858&site=qq&menu=yes">360252858</a></li>
    </ul>
</div>
    <script>
        //滑块切换

        var ljmdPage = 1;
        var ljmdPageSize = 10;
        var sspmPage = 1;
        var sspmPageSize = 10;
        var sspmPeriodsId = <?php echo ($periodsId); ?>;
        var sspmSort = 0;
        
        //历史领奖名单
        function loadLJMD() {
            Url = "<?php echo U('Rank/callback');?>"+"?page="+ljmdPage+"&pagesize="+ljmdPageSize;
            $.ajax({type:'get',url:Url,async:false,success:function(data){
                if (data.status == 1) {
                    html = '';
                    RankListData = data.list;
                    for(var item in RankListData){
                        html += '<tr>';
                        html += '   <td>'+RankListData[item].name+'</td>';
                        if (RankListData[item].sort <= 3) {
                            html += '<td class="pm"><img src="/Public/skin/images/d'+RankListData[item].sort+'.jpg" /></td>';
                        } else {
                            html += '<td class="pm1"><span>'+RankListData[item].sort+'</span></td>';
                        }
                        html += '   <td>'+RankListData[item].jjed+'%</td>';
                        html += '   <td>'+RankListData[item].syl+'%</td>';
                        if (RankListData[item].sflj == 0) {
                            html += '<td>否</td>';
                        } else {
                            html += '<td>是</td>';
                        }
                        html += '   <td>'+RankListData[item].periods+'</td>';
                        html += '</tr>';
                    }
                    $("#LjmdResult").html(html);
                    $('#LjmdPage').html(data.page);
                } else {
                    $("#LjmdResult").html('<tr><td colspan="6" align="center">无数据！</td></tr>');
                    $('#LjmdPage').html('');
                }
            }});
        }

        //赛事排名
        function loadSSPM() {
            Url = "<?php echo U('Rank/callback2');?>"+"?page="+sspmPage+"&pagesize="+sspmPageSize+"&periodsId="+sspmPeriodsId+"&sort="+sspmSort;
            $.ajax({type:'get',url:Url,async:false,success:function(data){
                if (data.status == 1) {
                    html = '';
                    RankListData = data.list;
                    for(var item in RankListData){
                        html += '<tr>';
                        if (RankListData[item].sort <= 3) {
                            html += '<td class="pm"><img src="/Public/skin/images/d'+RankListData[item].sort+'.jpg" /></td>';
                        } else {
                            html += '<td class="pm1"><span>'+RankListData[item].sort+'</span></td>';
                        }
                        html += '   <td>'+RankListData[item].name+'</td>';
                        html += '   <td>'+RankListData[item].zzc+'%</td>';
                        html += '   <td>'+RankListData[item].zongsyl+'%</td>';
                        html += '   <td>'+RankListData[item].zousyl+'%</td>';
                        html += '   <td>'+RankListData[item].rsyl+'%</td>';
                        html += '   <td>'+RankListData[item].cw+'%</td>';
                        html += '   <td>'+RankListData[item].zcg+'</td>';
                        html += '</tr>';
                    }
                    $("#SsbmResult").html(html);
                    $('#SsbmPage').html(data.page);
                } else {
                    $("#SsbmResult").html('<tr><td colspan="8" align="center">无数据！</td></tr>');
                    $('#SsbmPage').html('');
                }
            }});
        }

        function goToPage(page) {
            ljmdPage = page;
            loadLJMD();
        }

        function goToPage2(page) {
            sspmPage = page;
            loadSSPM();
        }

        $(document).ready(function(){ 
            loadLJMD();
            loadSSPM();

            $('#sspmhk_tab li').click(function() {
                var dataValue = $(this).attr('data-value');
                $(this).addClass('on');
                $(this).siblings().removeClass('on');
                sspmPeriodsId = dataValue;
                sspmPage = 1;
                sspmSort = 0;
                loadSSPM();
            })
        });

        function SortFun(type) {
            var dataValue;
            MCObj = $('#MCObj');
            ZZCObj = $('#ZZCObj');
            ZSYLObj = $('#ZSYLObj');
            if (type == 'mc') {
                dataValue = MCObj.attr('data-value');
                if (dataValue == 0 || dataValue == 2) {
                    MCObj.attr('data-value', 1);
                    MCObj.attr('class','px_up');
                    sspmSort = 1;
                } else if (dataValue == 1) {
                    MCObj.attr('data-value', 2);
                    MCObj.attr('class','px_down');
                    sspmSort = 2;
                }
                ZZCObj.attr('data-value',0);
                ZZCObj.attr('class','px_none');
                ZSYLObj.attr('data-value',0);
                ZSYLObj.attr('class','px_none');
            } else if (type == 'zzc') {
                dataValue = ZZCObj.attr('data-value');
                if (dataValue == 0 || dataValue == 4) {
                    ZZCObj.attr('data-value', 3);
                    ZZCObj.attr('class','px_up');
                    sspmSort = 3;
                } else if (dataValue == 3) {
                    ZZCObj.attr('data-value', 4);
                    ZZCObj.attr('class','px_down');
                    sspmSort = 4;
                }
                MCObj.attr('data-value',0);
                MCObj.attr('class','px_none');
                ZSYLObj.attr('data-value',0);
                ZSYLObj.attr('class','px_none');
            } else {
                dataValue = ZSYLObj.attr('data-value');
                if (dataValue == 0 || dataValue == 6) {
                    ZSYLObj.attr('data-value', 5);
                    ZSYLObj.attr('class','px_up');
                    sspmSort = 5;
                } else if (dataValue == 5) {
                    ZSYLObj.attr('data-value', 6);
                    ZSYLObj.attr('class','px_down');
                    sspmSort = 6;
                }
                MCObj.attr('data-value',0);
                MCObj.attr('class','px_none');
                ZZCObj.attr('data-value',0);
                ZZCObj.attr('class','px_none');
            }
            sspmPage = 1;
            loadSSPM();
        }
    </script>
</body>

</html>